from app.register import AppRegister


# application = Flask(__name__)

def create_app():
    application = AppRegister(__name__, 'dev')
    application.register_logger()
    application.logger.info("开始初始化应用...")
    application.register_manager()
    application.logger.info("配置加载完成")
    application.register_db()
    application.logger.info("数据库初始化完成")
    application.register_routes()
    application.logger.info("路由初始化完成")

    return application


application = create_app()


@application.route('/')
def hello_world():  # put application's code here
    return 'Hello World!'


if __name__ == '__main__':
    application.run(debug=True)
